/*
 * @Author: zhanyinjia
 * @Date: 2022-07-09 21:22:29
 * @LastEditTime: 2022-07-11 23:23:44
 * @LastEditors: zhanyinjia
 * @Description: 
 * @FilePath: \ts\rollup.config.js
 */
import ts from 'rollup-plugin-typescript2'  //解析ts的插件
import {nodeResolve} from '@rollup/plugin-node-resolve'; //解析第三方模块的插件
import serve from 'rollup-plugin-serve';  //启动本地服务的插件
import path from 'path'
export default {
    input:'1-base.ts',
    output:{
        format:'iife',  //打包成自执行函数的形式
        file:path.resolve('dist/bundle.js'), 
        sourcemap:true
    },
    plugins:[
        nodeResolve({
            extensions:['.js','.ts']
        }),
        ts({
            tsconfig:path.resolve(__dirname,'tsconfig.json')
        }),
        serve({
            open:false,
            openPage:'/public/index.html',
            port:3000,
            contentBase:''
        })
    ]
}